AnnieRoot.ui = AnnieRoot.ui || {};
AnnieRoot.ui.Ui = function () {
    var s = this;
    annie.Sprite.call(s);
    /*_a2x_need_start*/s.buttonTip_mc=null;s.playBtn=null;s.ropeTimesManager_mc=null;s.topUiCon=null;/*_a2x_need_end*/
    annie.initRes(s, "ui", "Ui");
    //your code here
    s.addEventListener(annie.Event.ADD_TO_STAGE, function (e) {
        s.topUiCon.y = s.stage.viewRect.y + 20;
        s.playBtn.y = s.stage.viewRect.height + s.stage.viewRect.y - 48 - 10;
        s.buttonTip_mc.y = s.stage.viewRect.height + s.stage.viewRect.y - 110 - 60;
    });
    s.buttonTip_mc.mouseChildren = false;
    s.buttonTip_mc.mouseEnable = false;

    //抛绳索按钮
    s.playBtn.addEventListener(annie.MouseEvent.CLICK, function (e) {
        if (AnnieRoot.gameGlobalData.isCatching){
            return;
        }
        if (s.buttonTip_mc.visible) {
            s.buttonTip_mc.visible = false;
        }
        //TODO 判断游戏次数
        annie.globalDispatcher.dispatchEvent('throwRopeEvent', {status: 'userClick'});//扔出绳子

    });
    /*改变按钮状态*/
    annie.globalDispatcher.addEventListener('changeUiBtnStatus', function (e) {
        var status = e.data;
        s.playBtn.gotoAndStop(status);
        if (status == 2) {
            s.buttonTip_mc.visible = true;
        } else {
            s.buttonTip_mc.visible = false;
        }
    })
    /**/
};
annie.A2xExtend(AnnieRoot.ui.Ui, annie.Sprite);
